﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WPFTetris.TetrisBoard;

namespace WPFTetris
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class WinTetris : Window
    {
        public WinTetris()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            tetrisBoard.AddTetrisPiece(LS, 0);
            tetrisBoard.AddTetrisPiece(RG, 2);
            tetrisBoard.AddTetrisPiece(T, 2);
            tetrisBoard.AddTetrisPiece(Sq, 2);
            tetrisBoard.AddTetrisPiece(I, 5);
            tetrisBoard.AddTetrisPiece(I, 5);
            tetrisBoard.AddTetrisPiece(I, 5);
            tetrisBoard.AddTetrisPiece(I, 5);
            tetrisBoard.AddTetrisPiece(RS, 0);
            tetrisBoard.AddTetrisPiece(T, 0);
        }

        private void piece_MouseDown(object sender, MouseButtonEventArgs e)
        {
            TetrisPiece tp = TetrisPiece.Clone(sender as TetrisPiece);
            tp.Margin = new Thickness(5);
            spQueue.Children.Add(tp);
        }
    }
}
